-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Add self-hosted runners v2 #4506
Conversation
A list of things that are different between Github-runners and our self-hosted runners for future reference:
|
We're now using I would have liked to set an env variable at the top of the play that could have been used to de-duplicate some of the |
if these additions differ from the GitHub-hosted runners (i.e., install 7zip), I'll add them to the runner image. I'll document where and how to update the images Real Soon™️, too. |
.github/workflows/test-suite.yml
Outdated
- name: Install apt dependencies | ||
if: env.SELF_HOSTED_RUNNERS | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libpq-dev # Required for Postgres in ./watch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could probably remove this once this is baked into the self hosted runner image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed!
This is ready for review! 🎉 |
.github/workflows/test-suite.yml
Outdated
@@ -61,14 +65,15 @@ jobs: | |||
- name: Install Foundry (anvil) | |||
uses: foundry-rs/foundry-toolchain@v1 | |||
- name: Run tests in release | |||
run: make test-release | |||
run: WATCH_HOST=host.docker.internal make test-release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may not work on GitHub hosted runners if they're not running in docker containers, perhaps we can leave it empty if env.SELF_HOSTED_RUNNERS == false
so it defaults to localhost
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I had a shot at fixing this in ce4ed6e.
.github/workflows/test-suite.yml
Outdated
@@ -143,7 +153,7 @@ jobs: | |||
- name: Install Foundry (anvil) | |||
uses: foundry-rs/foundry-toolchain@v1 | |||
- name: Run tests in debug | |||
run: make test-debug | |||
run: WATCH_HOST=host.docker.internal make test-debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -83,6 +88,7 @@ jobs: | |||
- name: Install make | |||
run: choco install -y make | |||
- uses: KyleMayes/install-llvm-action@v1 | |||
if: env.SELF_HOSTED_RUNNERS == false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good with this but just something worth thinking - Is there any benefit of leaving these conditionals out?
There are a few benefits:
- CI be always the same dep versions on self-hosted / github-hosted runners
- For Rust, the workflow will automatically update to latest version as soon as it's released, it could take an extra 15s or more to install. But then we'll know we need to update our runner image.
Downside:
- it could be a bit slower, but AFAIK
rustup update stable
just returns immediately if we're already on the same version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the self-hosted runners fail if we run that llvm install action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with the Rust update ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh privileges! happy to leave it as it is 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be ideal if we can have the images perform exactly the same. Perhaps we can make an issue to come back for it.
I suspect that we're going to eventually drift into the territory of Github-hosted runners failing, though. If we're not actually testing on the Github-hosted ones they're bound to bit-rot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good point - I'm hesitant to make the workflow more complicated, but if we really want to run GitHub-hosted runners, we could still run them on PRs, and use the self-hosted ones on staging
😛 , but perhaps something to think about later down the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Woot, excited to have this merged 🔥 🚀 🎉 ⏩ ⏩ ⏩
I'll merge this when CI passes 🎉 |
Yay, CI passed 🎉 bors r+ |
## Issue Addressed NA ## Proposed Changes Carries on from #4115, with the following modifications: 1. Self-hosted runners are only enabled if `github.repository == sigp/lighthouse`. - This allows forks to still have Github-hosted CI. - This gives us a method to switch back to Github-runners if we have extended downtime on self-hosted. 1. Does not remove any existing dependency builds for Github-hosted runners (e.g., installing the latest Rust). 1. Adds the `WATCH_HOST` environment variable which defines where we expect to find the postgres db in the `watch` tests. This should be set to `host.docker.internal` for the tests to pass on self-hosted runners. ## Additional Info NA Co-authored-by: antondlr <[email protected]>
Pull request successfully merged into unstable. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
## Issue Addressed NA ## Proposed Changes Carries on from sigp#4115, with the following modifications: 1. Self-hosted runners are only enabled if `github.repository == sigp/lighthouse`. - This allows forks to still have Github-hosted CI. - This gives us a method to switch back to Github-runners if we have extended downtime on self-hosted. 1. Does not remove any existing dependency builds for Github-hosted runners (e.g., installing the latest Rust). 1. Adds the `WATCH_HOST` environment variable which defines where we expect to find the postgres db in the `watch` tests. This should be set to `host.docker.internal` for the tests to pass on self-hosted runners. ## Additional Info NA Co-authored-by: antondlr <[email protected]>
## Issue Addressed NA ## Proposed Changes Carries on from sigp#4115, with the following modifications: 1. Self-hosted runners are only enabled if `github.repository == sigp/lighthouse`. - This allows forks to still have Github-hosted CI. - This gives us a method to switch back to Github-runners if we have extended downtime on self-hosted. 1. Does not remove any existing dependency builds for Github-hosted runners (e.g., installing the latest Rust). 1. Adds the `WATCH_HOST` environment variable which defines where we expect to find the postgres db in the `watch` tests. This should be set to `host.docker.internal` for the tests to pass on self-hosted runners. ## Additional Info NA Co-authored-by: antondlr <[email protected]>
Issue Addressed
NA
Proposed Changes
Carries on from #4115, with the following modifications:
github.repository == sigp/lighthouse
.WATCH_HOST
environment variable which defines where we expect to find the postgres db in thewatch
tests. This should be set tohost.docker.internal
for the tests to pass on self-hosted runners.Additional Info
NA